package com.zhouwd.zcamera;

import android.content.res.AssetManager;

import com.zhouwd.zcamera.entity.StartRecordParam;

public class JniUtil {

    static {
        try {
            //System.loadLibrary("x264");
            System.loadLibrary("camera-render");
        } catch (Exception e) {
            e.printStackTrace();
        }

    }

    /**
     * 开始录制
     * @param startRecordParam
     * @return
     */
    public static native boolean startRecord(StartRecordParam startRecordParam);

    /**
     * 停止录制
     */
    public static native void stopRecord();


    /**
     * 往底层写视频源数据
     * @param data
     * @param width
     * @param height
     */
    public static native void sendFrameData(byte[] data, int width, int height);

    public static native void sendAudioData(byte[] data);

    //初始化本地GLES
    public static native boolean init(AssetManager assetManager);

    public static native boolean initMediaRecord(String filename);

    public static native boolean releaseMediaRecord();

    //为本地GLES设置宽和高
    public static native void resize(int width, int height);
    //用来绘制图形
    public static native void step();

}
